home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / lib / obsolete / chi_sqr1.pro < prev    next >
Text File  |  1997-07-08  |  668b  |  36 lines

  1. ; $Id: chi_sqr1.pro,v 1.2 1997/01/15 04:02:19 ali Exp $
  2. ;
  3. ;  Copyright (c) 1991-1997, Research Systems Inc.  All rights
  4. ;  reserved. Unauthorized reproduction prohibited.
  5.  
  6.  
  7. function chi_sqr1,X,DF
  8. ;+
  9. ;
  10. ; NAME:
  11. ;    CHI_SQR1
  12. ;
  13. ; PURPOSE: 
  14. ;    CHI_SQR1 returns the probabilty of observing X or something smaller
  15. ;    from a chi square distribution with DF degrees of freedom.
  16. ;
  17. ; CATEGORY:
  18. ;    Statistics.
  19. ;
  20. ; CALLING SEQUENCE:
  21. ;    PROB = CHI_SQR1(X,DF)
  22. ;
  23. ; INPUTS:
  24. ;    X:    the cut off point
  25. ;    DF:    the degrees of freedom
  26. ;-
  27.  
  28. on_error,2     ; return to caller
  29.  
  30. if X le 0 THEN return,0 ELSE BEGIN
  31.   gres = rsi_gammai(DF/2.0,x/2.0)
  32.   if gres NE -1 then return, gres else return,-1
  33.   END
  34. end
  35.  
  36.